﻿/*-------------------------------------------------------------------------
* 命名空间: ScreenCapture.Common/WpfExtensions
* 类       名: WpfExtensions
* 功      能:  TD
* 时      间:  2023/12/4 16:01:06
* 版      本:  V1.0
* 作      者:  Fioman
* 格      言:  Talk is cheap,show me the code ^_^
*-------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace ScreenCapture.Common
{
    public static class WpfExtensions
    {
        public static void ShowAndFocus(this Window Window)
        {
            if (Window.IsVisible && Window.WindowState == WindowState.Minimized)
            {
                Window.WindowState = WindowState.Normal;
            }
            Window.Show();
            Window.Activate();
        }
    }
}
